<?php
/**
 * Icon.php
 * 
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 * @version    0.1
 */

/**
 * Naneau_View_Helper_Icon
 * 
 * simple helper that returns an <img> with the appropriate icon (using famfamfam's icons
 *
 * @category   Naneau
 * @package    Naneau_View_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 */
class Naneau_View_Helper_Icon {
    
    /**
     * get icon html
     *
     * @param string $name
     * @return string
     */
    public function icon($name, $alt = '') {
        if ($alt == '') {
            $alt = $name;
        }
        //make sure there's an alt (proper xhtml)
        
        $basePath = Zend_Controller_Front::getInstance()->getBaseUrl();
        $html = '<img class="icon" src="' . $basePath . '/img/icons/' . $name . '.png" ';
        $html .= 'alt="' . $alt .  '"/>';
        return $html;
    }
}